<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*"%>
<%@ page import="requestInterFace.Handle.userHandle"%>
<%@ page import="xml.response.*"%>
<%@ page import="xml.root"%>
<%@ page import="util.print.printLogCat"%>
<%@ page import="org.sql.table.*"%>
<%@ page import="xml.var"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="requestInterFace.UserInfoInterFace.*"%>
<%@ page import="jqgrid.jqgrid"%>
<%@ page import="org.util.getNewData"%>
<%@ page import="util.check"%>
<%@ include file="../../util/paramPrint.jsp" %>
<%@ page trimDirectiveWhitespaces="true" %> 
<%   

    /*********** jqgrid ******************/
		jqgrid jq=new jqgrid();
		jq.setRows(request.getParameter(jqgrid._rows));
		jq.setSord(request.getParameter(jqgrid._sord));
		jq.setSortname(request.getParameter(jqgrid._sortname));
		jq.setPage(request.getParameter(jqgrid._page));
		jq.setOper(request.getParameter(jqgrid._oper));
		jq.setSearch(request.getParameter(jqgrid._search));
		/*************************************/
		
String Product_ID = request.getParameter("Product_ID");		
String Product_Name = request.getParameter("Product_Name");
String Product_Price = request.getParameter("Product_Price");
String Product_DESC = request.getParameter("Product_DESC");
String Product_Type = request.getParameter("Product_Type");
String userType=(String)session.getAttribute("User_Type");
root root=new root();
if(userType==null||!userType.equals("1")){
root.setStatus("false");
root.setMsg("权限不够");
PrintWriter pw = response.getWriter();
pw.println(root.getXmlString());
pw.flush();
return ;
}
 
		productinfo1_1 user=new productinfo1_1();
		if(Product_ID!=null&&(!Product_ID.equals(""))){
		 user.addequwhile("Product_ID"," = ",Product_ID);
		}else{
		    root.setStatus("false");
			root.setMsg("请输入产品ID");
			PrintWriter pw = response.getWriter();
			pw.println(root.getXmlString());
			pw.flush();
			return ;
		}
		if(Product_Name!=null&&(!Product_Name.equals(""))){
		 user.setUpdateField("Product_Name",Product_Name);
		}
		
		if(Product_Price!=null&&(!Product_Price.equals(""))){
		   if(check.isNumeric(Product_Price)){
		    user.setUpdateField("Product_Price",Product_Price);
		   }else{
		    root.setStatus("false");
			root.setMsg("请输入正确的价格值");
			PrintWriter pw = response.getWriter();
			pw.println(root.getXmlString());
			pw.flush();
			return ;
		   }
		}
		
		if(Product_DESC!=null&&(!Product_DESC.equals(""))){
		 
		     user.setUpdateField("Product_DESC",Product_DESC);
		  
		
		}
		if(Product_Type!=null&&(!Product_Type.equals(""))){
		  user.setUpdateField("Product_Type",Product_Type);
		}
	    user.setUpdateField("Product_AddTime",getNewData.GetNowDateAndTime1());
		user.setUpdateField("Product_Adder",(String)session.getAttribute("User_ID"));
		int row=user.updata();
		root.setRecords(""+row);//设置当前查询到的记录数
		if(row>0){
			root.setStatus("true");
			root.setMsg("修改成功");
		}else{
			root.setStatus("false");
			root.setMsg("修改失败");
		}
		//printLogCat.printlnWriter(root.getXmlString());
		String rep=root.getXmlString();
%>
<%=rep%>

